package 进制转换;

import java.math.BigInteger;
import java.util.Scanner;
// N 转 10
public class 十六进制转十进制 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        BigInteger b = new BigInteger(a,16);


        System.out.println(b);
    }


}
